﻿@model IEnumerable<DegreeDto>
@{
    var groupByGroup = Model.GroupBy(a => a.Quize.Group.Name);
}

@section MainStyle{

    <!-- bradcam_area_start -->
    <div class="bradcam_area breadcam_bg overlay2">
        <h3>Degrees</h3>
    </div>
    <!-- bradcam_area_end -->

}
@foreach (var degree in groupByGroup)
{
    <table class="table table-hover">
        <caption style="text-align:center"><span class="btn btn-info">@degree.Key Group</span></caption>
        <thead class="thead-dark">
            <tr>
                <th>Quize</th>
                <th>
                    Degree
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in degree)
            {
                <tr>
                    <td>@item.Quize.Description</td>
                    @{ var color = item.ExamDegree >= item.TotalDegree / 2 ? "#00800087" : "#ff00008a";}
                    <td style="background-color:@color;font-size:20px;color:white">
                        @($"{item.ExamDegree}/{item.TotalDegree}")
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
